package com.zenchn.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

@ApiModel(value="数据字典",description="系数据字典对象")
public class TSysDict implements Serializable {

    private static final long serialVersionUID = 2111839406269439379L;
    @ApiModelProperty(value="字典ID")
    private String dictId;

    @NotEmpty(message = "字典类型ID不能为空")
    @ApiModelProperty(value="字典类型ID")
    private String dictTypeId;

    @ApiModelProperty(value="创建时间",hidden = true)
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @NotNull(message = "是否启用不能为空")
    @ApiModelProperty(value="是否启用")
    private Boolean isEnable;

    @NotEmpty(message = "字典名称不能为空")
    @ApiModelProperty(value="字典名称")
    private String dictName;

    @NotEmpty(message = "字典编码不能为空")
    @ApiModelProperty(value="字典编码")
    private String dictCode;

    @NotEmpty(message = "字典值不能为空")
    @ApiModelProperty(value="字典值")
    private String dictValue;

    @NotNull(message = "排序不能为空")
    @ApiModelProperty(value="排序")
    private Short sorts;

    @ApiModelProperty(value="上级字典ID")
    private String parentId;

    @ApiModelProperty(value="字典层级",hidden = true)
    private Integer dataLevel;

    @ApiModelProperty(value="备注")
    private String memo;


    public String getDictId() {
        return dictId;
    }

    public void setDictId(String dictId) {
        this.dictId = dictId == null ? null : dictId.trim();
    }

    public String getDictTypeId() {
        return dictTypeId;
    }

    public void setDictTypeId(String dictTypeId) {
        this.dictTypeId = dictTypeId == null ? null : dictTypeId.trim();
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public Boolean getIsEnable() {
        return isEnable;
    }

    public void setIsEnable(Boolean isEnable) {
        this.isEnable = isEnable;
    }

    public String getDictName() {
        return dictName;
    }

    public void setDictName(String dictName) {
        this.dictName = dictName == null ? null : dictName.trim();
    }

    public String getDictCode() {
        return dictCode;
    }

    public void setDictCode(String dictCode) {
        this.dictCode = dictCode == null ? null : dictCode.trim();
    }

    public String getDictValue() {
        return dictValue;
    }

    public void setDictValue(String dictValue) {
        this.dictValue = dictValue == null ? null : dictValue.trim();
    }

    public Short getSorts() {
        return sorts;
    }

    public void setSorts(Short sorts) {
        this.sorts = sorts;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId == null ? null : parentId.trim();
    }

    public Integer getDataLevel() {
        return dataLevel;
    }

    public void setDataLevel(Integer dataLevel) {
        this.dataLevel = dataLevel;
    }

    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo == null ? null : memo.trim();
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", dictId=").append(dictId);
        sb.append(", dictTypeId=").append(dictTypeId);
        sb.append(", createTime=").append(createTime);
        sb.append(", isEnable=").append(isEnable);
        sb.append(", dictName=").append(dictName);
        sb.append(", dictCode=").append(dictCode);
        sb.append(", dictValue=").append(dictValue);
        sb.append(", sorts=").append(sorts);
        sb.append(", parentId=").append(parentId);
        sb.append(", dataLevel=").append(dataLevel);
        sb.append(", memo=").append(memo);
        sb.append("]");
        return sb.toString();
    }
}